import { tfGet, yfuPost } from '@/utils/request'

export function getModuleList (param, then1, error1) {
  tfGet('/static/moduleList.json', then1, error1)
}

export function newModule (param, then1, error1) {
  yfuPost(process.env.BASE_API, '/module/save', param, then1, error1)
}

export let getModuleById = {
  name: '根据ID得到对应的模块',
  url: '/static/oneModule.json',
  functionName: 'getModuleById'
}

export let getModuleListRemote = {
  name: '服务端得到所有的模块信息',
  url: '/module/selectAll',
  functionName: 'selectAll'
}
export let saveModuleRemote = {
  name: '服务端新增模块信息',
  url: '/module/saveModule',
  functionName: 'saveModule'
}
export let updateModuleRemote = {
  name: '服务端修改模块信息',
  url: '/module/updateModule',
  functionName: 'updateModule'
}
export let deleteModuleRemote = {
  name: '服务端删除模块信息',
  url: '/module/deleteModule',
  functionName: 'deleteModule'
}

export let getModuleMenuRemote = {
  name: '服务端得到所有的模块信息',
  url: '/module/selectMenu',
  functionName: 'selectMenu'
}
